#include "./../Include/public.h"
void course_input_keyboard()
{
	printf("键盘录入输入-1时结束\n");
	printf("输入课程信息：\n");
	printf("模式:课程号 课程名称 课程性质 学时 学分 课程已选人数 课程人数上线\n");
	while (1) {
		int flag = 0;
		struct course* node = (struct course*)malloc(sizeof(struct course));
		scanf("%d",&node->cno);
		if (node->cno == -1) return; 
		scanf("%s %s %d %d %d %d",node->cname,node->type,&node->ctime,&node->score,&node->chose,&node->limit);
		if (head_course == NULL) {
			head_course = node;
			printf("OK\n");
		} else {
			struct course *p = head_course;
			struct course *q = p;
			while (p != NULL) {
				if (p->cno == node->cno) {
					printf("学生已存在！\n");
					flag = 1;
					break;
				}
				q = p;	
				p = p->next;
			}
			if (flag) continue;
			q->next = node;
			node->next = NULL; 
			printf("OK\n");
		}
	}
}
